<template>
    <div>
        --
        <button @click="muationsOn">muations</button>
        <button @click="actionOn">actionOn</button>
    </div>
</template>

<script lang="ts">
    import { defineComponent, computed } from "vue";
    import { useStore } from "vuex";
    export default defineComponent({
        setup() {
            const store = useStore(); //获取store
            let count = computed(() => {
                return store.state.number;
            });
            let count2 = computed(() => {
                return store.getters.newNumber;
            });
            const muationsOn = () => {
                store.commit("aaNumber");
            };
            const actionOn = () => {
                store.dispatch("aaNumberchange");
            };
            return {
                count,
                count2,
                muationsOn,
                actionOn,
            };
        },
    });
</script>